@extends('admin.layouts.base')

@section('title','控制面板')

@section('pageHeader','控制面板')

@section('pageDesc','DashBoard')

@section('content')
    <div class="main animsition">
        <div class="container-fluid">

            <div class="row">
                <div class="">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">导入微信</h3>
                        </div>
                        <div class="panel-body">

                            @include('admin.partials.errors')
                            @include('admin.partials.success')
                            <form class="form-horizontal" role="form" method="POST"
                                  action="/admin/wechat/import" enctype="multipart/form-data">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                             @if(auth()->user()->id === 1)
								<div class="form-group">
									<label for="tagUid" class="col-md-3 control-label">所属用户</label>
									<div class="col-md-5">
										<select class="form-control" name="uid" id="tagUid"
												onchange="$('#username').val($(this).find('option:selected').text());">
											@foreach ($userList as $id=>$name)
												<option value="{{ $id }}" @if ($id === $uid) selected="selected" @endif>{{ $name }}</option>
											@endforeach
										</select>
										<input type="hidden" id="username" name="username" value="{{ empty($username) ? $userList[1] : $username}}">
									</div>
								</div>
								@else
									<input type="hidden" id="username" name="username" value="{{auth()->user()->name}}">
								@endif
								<div class="form-group">
									<label for="tag" class="col-md-3 control-label">微信号(请导入txt或csv文件)</label>
									<div class="col-md-5">
										<input type="file" accept="text/csv,text/plain,.csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" class="form-control" name="wechat" id="tag"/>
									</div>
								</div>
								
								<div class="form-group">
									<label for="tagWx_nike" class="col-md-3 control-label">微信昵称</label>
									<div class="col-md-5">
										<input type="text" class="form-control" name="wx_nike" id="tagWx_nike" value="">
									</div>
								</div>
								<div class="form-group">
									<label for="tagGroup" class="col-md-3 control-label">分组</label>
									<div class="col-md-5">
										<select class="form-control" name="group" id="tagGroup">
										<option value="0">请选择分组</option>
										  @foreach($wechatgroup as $v)
											<option value="{{$v->id}}" >{{$v->name}} @if(auth()->user()->id==1) &nbsp;&nbsp;&nbsp;---&nbsp;&nbsp;&nbsp;{{$v->username}} @endif</option>
										   @endforeach
										</select>
									</div>
								</div>

								<div class="form-group">
									<label for="tagMax_rand" class="col-md-3 control-label">随机值</label>
									<div class="col-md-5">
										<input type="text" class="form-control" name="max_rand" id="tagMax_rand" value="">
									</div>
								</div>

								<div class="form-group">
									<label for="tagOnline_time" class="col-md-3 control-label">客服上线时间</label>
									<div class="col-md-5">
										<input type="time" class="form-control" name="online_time" id="tagOnline_time"  value="{{ $online_time or '09:00' }}">
									</div>
								</div>
								<div class="form-group">
									<label for="tagOffline_time" class="col-md-3 control-label">客服下线时间</label>
									<div class="col-md-5">
										<input type="time" class="form-control" name="offline_time" id="tagOffline_time" value="{{ $offline_time or '18:00' }}">
									</div>
								</div>
								<div class="form-group">
									<label for="tagStatus" class="col-md-3 control-label">状态</label>
									<div class="col-md-5">
										<select class="form-control" name="status" id="tagStatus">
										  
											<option value="0" @if ($status === 0) selected="selected" @endif>禁用</option>
											<option value="1" @if ($status === 1) selected="selected" @endif>正常</option>
											<option value="2" @if ($status === 2) selected="selected" @endif>暂封</option>
											<option value="3" @if ($status === 3) selected="selected" @endif>永封</option>
											
										</select>
									</div>
								</div>								
								
                                <div class="form-group">
                                    <div class="col-md-7 col-md-offset-3">
                                        <button type="submit" class="btn btn-primary btn-md">
                                            <i class="fa fa-plus-circle"></i>
                                            保存
                                        </button>
                                    </div>
                                </div>

                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop